from django.db import models
from datetime import datetime


class BaseModel(models.Model):  # 后期会用到这些字段
    add_time = models.DateTimeField(default=datetime.now, verbose_name="添加时间")
    update_time = models.DateTimeField(auto_now=True, verbose_name='最后更新时间')
    is_delete = models.BooleanField(default=False, verbose_name='是否删除')
    is_show = models.BooleanField(default=True, verbose_name='是否展示')
    # display_order = models.IntegerField()  # 展示顺序，暂时没用到
    index = models.IntegerField(default=0, verbose_name="展示顺序")

    class Meta:
        abstract = True  # 设置成虚拟表，数据库不会产生这个表
